package com.itheima03;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class FuWuQi {
    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(10000);

        Socket accept = serverSocket.accept();

        BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(accept.getOutputStream()));
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(accept.getInputStream()));

        String s = bufferedReader.readLine();
        System.out.println("客户端说:" + s);

        bufferedWriter.write("您也好!");
        bufferedWriter.newLine();
        bufferedWriter.flush();

        serverSocket.close();
    }
}
